<?php
class omedlyexport_finder_delivery{
    var $actions = array(
        array(
            'label'=>'导出',
            'submit'=>'index.php?app=omedlyexport&ctl=ome_delivery&act=index&action=export',
            'target'=>'dialog::{width:400,height:170,title:\'导出\'}'
        ),
    );

    var $column_tax_no = "发票号";
    var $column_tax_no_width = "80";
    function column_tax_no($row){
        $delivery_id = $row['delivery_id'];
        $sql = 'SELECT O.order_bn,O.tax_no FROM sdb_ome_orders AS O LEFT JOIN 
            sdb_ome_delivery_order AS DO ON DO.order_id=O.order_id WHERE DO.delivery_id='.$delivery_id;
        $orders = kernel::database()->select($sql);
        $tax_no = array();
        foreach($orders as $order){
            $tax_no[] = $order['tax_no'];
        }
        return '<span title="'.implode('、',$tax_no).'">'.implode('、',$tax_no).'</span>';
    }
}